import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/system/user/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/system/user/detail',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/system/user/logout',
    method: 'get'
  })
}

export function updateUserPwd(data) {
  return request({
    url: '/system/user/update/password',
    method: 'put',
    data
  })
}

export function updateUserProfile(data) {
  return request({
    url: '/system/user/info',
    method: 'put',
    data
  })
}

export function uploadAvatar(data) {
  return request({
    url: '/system/user/avatar',
    method: 'post',
    data
  })
}

export function register(data) {
  return request({
    url: '/system/user/enterprise/register',
    method: 'post',
    data
  })
}

export function resetPassword(data) {
  return request({
    url: '/system/user/reset/password',
    method: 'put',
    data
  })
}
